package com.vcaresolution.logistic.to;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.validation.constraints.NotNull;

import com.vcaresolution.logistic.pojo.User;
import com.vcaresolution.logistic.util.SecurityTokenHandler;

public class UserProfileTO extends User{

	private static final long serialVersionUID = 1L;

	private Integer securityQuestionId;
	private Integer companyId;
	private Integer userGroupId;
	private Set<Integer> branchId;
	private Set<Integer> departmentId;
	
	Map<String, List<String>> userTokenValues = new HashMap<String, List<String>>();
	
	private String branchCode;
	
	public String getBranchCode() {
		return branchCode;
	}
	public void setBranchCode(String branchCode) {
		this.branchCode = branchCode;
	}
	
	@NotNull
	public Integer getSecurityQuestionId() {
		return securityQuestionId;
	}
	public void setSecurityQuestionId(Integer securityQuestionId) {
		this.securityQuestionId = securityQuestionId;
	}
	
	@NotNull
	public Integer getCompanyId() {
		return companyId;
	}
	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}
	
	@NotNull
	public Integer getUserGroupId() {
		return userGroupId;
	}
	public void setUserGroupId(Integer userGroupId) {
		this.userGroupId = userGroupId;
	}
	public void setBranchId(Set<Integer> branchId) {
		this.branchId = branchId;
	}
	public Set<Integer> getBranchId() {
		return branchId;
	}
	public void setDepartmentId(Set<Integer> departmentId) {
		this.departmentId = departmentId;
	}
	public Set<Integer> getDepartmentId() {
		return departmentId;
	}
	
	/**
	 * @return the userTokenValues
	 */
	public Map<String, List<String>> getUserTokenValues() {
		return userTokenValues;
	}
	/**
	 * @param userTokenValues the userTokenValues to set
	 */
	public void setUserTokenValues(Map<String, List<String>> userTokenValues) {
		this.userTokenValues = userTokenValues;
	}
	
	public boolean hasTokenRights(String applicationName,String tokenValue){
		
		SecurityTokenHandler securityTokenHandler = new SecurityTokenHandler();
		
		return securityTokenHandler.getTokenRights(applicationName, tokenValue);
		
		
	}
}
